<!DOCTYPE html>
<html>

<head>
    <style>
        table,
        th,
        td {
            border: 1px solid black;
        }
    </style>
</head>

<body>

    <h2>Pivot table with with 1 row header</h2>

    <table>
        <tr>
            <th>Year</th>
            <th>Month</th>
            <th>Revenue</th>
            <th>Cost</th>
        </tr>
        <tr>
            <th rowspan="6">2025</th>
        </tr>
        <tr>
            <td>January</td>
            <td>$134</td>
            <td>$162</td>
        </tr>
        <tr>
            <td>February</td>
            <td>$150</td>
            <td>$155</td>
        </tr>
        <tr>
            <td>March</td>
            <td>$160</td>
            <td>$143</td>
        </tr>
        <tr>
            <td>April</td>
            <td>$210</td>
            <td>$150</td>
        </tr>
        <tr>
            <td>May</td>
            <td>$280</td>
            <td>$120</td>
        </tr>
    </table>

    <h2>Pivot table with 2 row headers</h2>

    <table>
        <tr>
            <th>Year</th>
            <th>Quarter</th>
            <th>Month</th>
            <th>Revenue</th>
            <th>Cost</th>
        </tr>
        <tr>
            <th rowspan="7">2025</th>
            <th rowspan="4">Q1</th>
        </tr>
        <tr>
            <td>January</td>
            <td>$134</td>
            <td>$162</td>
        </tr>
        <tr>
            <td>February</td>
            <td>$150</td>
            <td>$155</td>
        </tr>
        <tr>
            <td>March</td>
            <td>$160</td>
            <td>$143</td>
        </tr>
        <tr>
            <th rowspan="3">Q2</th>
        </tr>
        <tr>
            <td>April</td>
            <td>$210</td>
            <td>$150</td>
        </tr>
        <tr>
            <td>May</td>
            <td>$280</td>
            <td>$120</td>
        </tr>
    </table>

    <h2>Equivalent pivot table</h2>

    <table>
        <tr>
            <th>Year</th>
            <th>Quarter</th>
            <th>Month</th>
            <th>Revenue</th>
            <th>Cost</th>
        </tr>
        <tr>
            <th rowspan="8">2025</th>
            <th rowspan="4">Q1</th>
        </tr>
        <tr>
            <td>January</td>
            <td>$134</td>
            <td>$162</td>
        </tr>
        <tr>
            <td>February</td>
            <td>$150</td>
            <td>$155</td>
        </tr>
        <tr>
            <td>March</td>
            <td>$160</td>
            <td>$143</td>
        </tr>
        <tr>
            <th rowspan="3">Q2</th>
        </tr>
        <tr>
            <td>April</td>
            <td>$210</td>
            <td>$150</td>
        </tr>
        <tr>
            <td>May</td>
            <td>$280</td>
            <td>$120</td>
        </tr>
    </table>

</body>

</html>